package com.bdqn.crm.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdqn.crm.mapper.SysRightMapper;
import com.bdqn.crm.pojo.SysRight;
import com.bdqn.crm.pojo.SysRole;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.management.relation.Role;
import java.util.List;
@Service
public class SysRightServiceImpl extends ServiceImpl<SysRightMapper, SysRight> implements SysRightService{
    @Resource
    private SysRightMapper sysRightMapper;
    /**
     * 查询所有权限
     *
     * @return
     */
    @Override
    public List<SysRight> findAllRights() {
        return sysRightMapper.findAllRights();
    }

    /**
     * 根据角色查询权限
     *
     * @param role
     * @return
     */
    @Override
    public List<SysRight> findRightsByRole(SysRole role) {
        return sysRightMapper.findRightsByRole(role);
    }

}
